import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:archime/robot.dart';

class Job extends StatelessWidget {
  Widget buildTileButton(BuildContext context, String text, IconData icon) {
    return new Container(
        color: Colors.white,
        height: ScreenUtil().setHeight(110),
        child: new FlatButton(
            onPressed: /**_readArticle(position)*/ () {
              Widget path = Robot(
                title: text,
              );
              Navigator.push(
                  context, new MaterialPageRoute(builder: (context) => path));
            },
            child: new Center(
                child: new ListTile(
                  leading: new Icon(icon, size: ScreenUtil().setSp(60)),
                  title: new Text(text),
            ))));
  }

  @override
  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: new AppBar(
        title: new Text("发现"),
        actions: <Widget>[
          new IconButton(
            icon: new Icon(Icons.list),
            onPressed: () {},
          ),
        ],
        elevation: 0.0,
      ),
      body: new Container(
        color: Colors.grey[200],
        child: new ListView(
          padding: EdgeInsets.only(top: ScreenUtil().setHeight(0)),
          children: <Widget>[
            buildTileButton(context, "朋友圈", Icons.timer),
            buildTileButton(context, "广场", Icons.remove_red_eye),
            new SizedBox(
              height: ScreenUtil().setHeight(10),
            ),
            new Divider(height: 0),
            buildTileButton(context, "解闷机器人", Icons.equalizer),
            new SizedBox(
              height: ScreenUtil().setHeight(10),
            ),
            buildTileButton(context, "财经新闻", Icons.remove_red_eye),
            buildTileButton(context, "价值助手", Icons.equalizer),
            new Divider(height: 0),
            buildTileButton(context, "穿衣指南", Icons.equalizer),
          ],
        ),
      ),
    );
  }
}
